<template>
  <div>
    <el-row class="tac">
      <el-col>
        <el-menu
          default-active="2"
          class="el-menu-vertical-demo"
          @open="handleOpen"
          @close="handleClose"
          background-color="#545c64"
          text-color="#fff"
          active-text-color="#ffd04b"
        >
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-location"></i>
              <span>租户管理</span>
            </template>
            <el-menu-item-group>
              <template slot="title"></template>
              <el-menu-item index="1-1" @click="openTenantIndex()">现有租户</el-menu-item>
              <el-menu-item index="1-2" @click="openTenantExpired()">到期租户</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-menu-item index="2">
            <i class="el-icon-menu"></i>
            <span slot="title" @click="openAddTenant()">加入新租户</span>
          </el-menu-item>
        </el-menu>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    openTenantIndex() {
      this.$router.push("/tenant/tenantIndex");
    },
    openAddTenant() {
      this.$router.push("/tenant/addTenant");
    },
    openTenantExpired() {
      this.$router.push("/tenant/tenantExpired");
    },
  },
  created() {},
};
</script>

<style></style>
